home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 July & August
/
PCWorld_2006-07-08_cd.bin
/
v cisle
/
acehtml
/
acehtmlfreeware.exe
/
scriptdef
/
Simple Calculator.sd
< prev
next >
Wrap
INI File
|
2004-06-28
|
1KB
|
56 lines
[SUBJECT]
Description=5 function calculator
ImageIndex=-1
Folder=Mathematics
[HEAD_TEXT]
;<script language="JavaScript">
;<!--
;function a_plus_b(form) {
;a=eval(form.a.value);
;b=eval(form.b.value);
;c=a+b;
;form.ans.value = c;
;}
;function a_minus_b(form) {
;a=eval(form.a.value);
;b=eval(form.b.value);
;c=a-b;
;form.ans.value=c;
;}
;function a_times_b(form) {
;a=eval(form.a.value);
;b=eval(form.b.value);
;c=a*b;
;form.ans.value=c;
;}
;function a_div_b(form) {
;a=eval(form.a.value);
;b=eval(form.b.value);
;c=a/b;
;form.ans.value = c;
;}
;function a_pow_b(form) {
;a=eval(form.a.value);
;b=eval(form.b.value);
;c=Math.pow(a, b);
;form.ans.value = c;
;}
;</script>
[BODY_TEXT]
;<div align="center">
;<form name="formx"><input type="text" size="4" value="12" name="a">
;<input type="button" value=" + " onClick="a_plus_b(this.form)">áá
;<input type="button" value=" - " onClick="a_minus_b(this.form)">áá
;<input type="button" value=" x " onClick="a_times_b(this.form)">áá
;<input type="button" value=" / " onClick="a_div_b(this.form)">áá
;<input type="button" value=" ^ " onClick="a_pow_b(this.form)">áá
;<input type="number" size="4" value="3" name="b"> = <input type="number" value="0" name="ans" size="9">
;</form>
;</div>